import request from "@/utils/request";

// 查询项目列表
export function listContractProject(query) {
  return request({
    url: "/contract/ContractProject/list",
    method: "get",
    params: query,
    handleError: true,
  });
}

// 查询项目详细
/**
 * 查询项目详细
 * @param {*} contractProjectId
 * @returns
 */
export function getContractProject(contractProjectId) {
  return request({
    url: "/contract/ContractProject/" + contractProjectId,
    method: "get",
    handleError: true,
  });
}

// 新增项目
export function addContractProject(data) {
  return request({
    url: "/contract/ContractProject",
    method: "post",
    data: data,
  });
}

// 修改项目
export function updateContractProject(data) {
  return request({
    url: "/contract/ContractProject",
    method: "put",
    data: data,
  });
}

// 删除项目
export function delContractProject(contractProjectId) {
  return request({
    url: "/contract/ContractProject/" + contractProjectId,
    method: "delete",
  });
}

/**
 * 查询项目所属公司还未选择的合同
 * @param {*} query
 * @returns
 */
export function listContractByContractProject(query) {
  return request({
    url: "/contract/ContractProject/unselectedContracts",
    method: "get",
    params: query,
    handleError: true,
  });
}
